package nodes;

import model.Model;
import nodes.AbstractUnaryNode;

/**
 * Used for representing "not" in the expression tree
 */
public class NotNode extends AbstractUnaryNode
{

    public NotNode (Model model)
    {
        super(model);
        myName = syntaxBundle.getString("not_label");
    }


    @Override
    public AbstractNode evaluate ()
    {
        if(myArgument.evaluate().getValue() == 0) return new ConstantNode(1);
        else return new ConstantNode(0);
    }

}
